package com.wangjie.account.controller;

import com.wangjie.account.service.AccountService;
import com.wangjie.common.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AccountController {
    @Autowired
    private AccountService accountService;

    @GetMapping("/debit")
    public R debit(@RequestParam("userId") String userId, @RequestParam("money") int money) {
        accountService.debit(userId, money);
        return R.ok("debit success...");
    }
}